package com.ywjt.pinkelephant.home.adapter;

import android.graphics.Color;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ywjt.pinkelephant.R;

import java.util.List;

public class ColorsAdapter extends BaseQuickAdapter<String, BaseViewHolder> {

    public ColorsAdapter(@Nullable List<String> data) {
        super(R.layout.item_color, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, String item) {
        TextView textView=helper.getView(R.id.tvColor);
        textView.setBackgroundColor(Color.parseColor("#"+item));
    }
}
